package aar.test.tessocr.baseApplication;

import android.app.Application;
import android.content.res.Resources;
import android.util.Log;


import com.tencent.bugly.crashreport.CrashReport;

import java.util.logging.Logger;

import aar.test.tessocr.model.CabDetailModel;
import aar.test.tessocr.model.CabinetListMpdel;
import aar.test.tessocr.model.LoginCabModel;
import aar.test.tessocr.model.SiteDispatchModel;
import aar.test.tessocr.model.loginModel;
import aar.test.tessocr.utils.toast.ToastMgr;
import lib_zxing.activity.ZXingLibrary;
import okgo.OkGo;

/**
 * Created by 149-201605 on 2016/8/8.
 */
public class BaseApplication extends Application {


    private static BaseApplication mBaseApplication = null;

    private LoginCabModel loginCabModel;

    public LoginCabModel getLoginCabModel() {
        return loginCabModel;
    }

    public void setLoginCabModel(LoginCabModel loginCabModel) {
        this.loginCabModel = loginCabModel;
    }

    private Boolean isLogin=false;

    private loginModel loginBean;

    public Boolean getLogin() {
        return isLogin;
    }

    public void setLogin(Boolean login) {
        isLogin = login;
    }

    public loginModel getLoginBean() {
        return loginBean;
    }

    public void setLoginBean(loginModel loginBean) {
        this.loginBean = loginBean;
    }

    private String  scanPhoneNub;

    public String getScanPhoneNub() {
        return scanPhoneNub;
    }

    public void setScanPhoneNub(String scanPhoneNub) {
        this.scanPhoneNub = scanPhoneNub;
    }

   private  CabDetailModel mCabDetailModel=null;

    public CabDetailModel getmCabDetailModel() {
        return mCabDetailModel;
    }

    public void setmCabDetailModel(CabDetailModel mCabDetailModel) {
        this.mCabDetailModel = mCabDetailModel;
    }

    private CabinetListMpdel CabinetListMpdel;

    public aar.test.tessocr.model.CabinetListMpdel getCabinetListMpdel() {
        return CabinetListMpdel;
    }

    public void setCabinetListMpdel(aar.test.tessocr.model.CabinetListMpdel cabinetListMpdel) {
        CabinetListMpdel = cabinetListMpdel;
    }

    private SiteDispatchModel mSiteDispatchModel;

    public SiteDispatchModel getmSiteDispatchModel() {
        return mSiteDispatchModel;
    }

    public void setmSiteDispatchModel(SiteDispatchModel mSiteDispatchModel) {
        this.mSiteDispatchModel = mSiteDispatchModel;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        mBaseApplication = this;

        OkGo.getInstance().init(this);
        //ZXingLibrary.initDisplayOpinion(this);
        CrashReport.initCrashReport(getApplicationContext(), "5c1e65711c", true);
        initToastMgr();
    }



    public static BaseApplication getIntance() {
        if (null == mBaseApplication) {
            mBaseApplication = new BaseApplication();
        }
        return mBaseApplication;
    }


    public static String getResourceString(int stringId) {
        String str = "";
        try {
            str = mBaseApplication.getResources().getString(stringId);
        } catch (Resources.NotFoundException e) {
        }
        return str;
    }

    /**
     * 初始化Toast
     */
    private void initToastMgr() {
        ToastMgr.ToastEnum.builder.init(getApplicationContext());
    }

}
